package com.ruoyi.web.controller.durian;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.durian.service.LlOrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private LlOrderService llOrderService;

    /**
     * 结算使用优惠券
     * @param orderId
     * @param couponId
     * @return
     */
    @PostMapping("/coupon/useCoupon")
    public AjaxResult useCoupon(Integer orderId, Integer couponId) {
        return llOrderService.useCoupon(orderId, couponId);
    }

}
